package org.nepu.srr.设备设施资料.环保设备证书;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.nepu.sc.domain.CommonIn;
import org.nepu.sc.domain.CommonMethods;

@Data
public class B47EnvironmentParams {
    @ApiModelProperty("污水分离器")
    CommonIn sewageSeparator;

    @ApiModelProperty("粪便处理器")
    CommonIn fecesProcessor;

    @ApiModelProperty("钻屑回收装置")
    CommonIn sludgeRecyclingDevice;

    public B47EnvironmentResult rate(){
        double fullScore = 15;
        double score = 0;
        if(CommonMethods.isAllTrue(sewageSeparator.getInput())){
            score += 5;
        }
        if(CommonMethods.isAllTrue(fecesProcessor.getInput())){
            score += 5;
        }
        if(CommonMethods.isAllTrue(sludgeRecyclingDevice.getInput())){
            score += 5;
        }
        double rate =score/fullScore;
        B47EnvironmentResult result = new B47EnvironmentResult();
        result.setRateScore(rate);
        String s = CommonMethods.toGrade(rate);
        result.setRateResult(s);
        return result;
    }
}
